// Copyright 2018-2021 Polyaxon, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/* tslint:disable */
/* eslint-disable */
/**
 * Polyaxon SDKs and REST API specification.
 * Polyaxon SDKs and REST API specification.
 *
 * The version of the OpenAPI document: 1.7.4
 * Contact: contact@polyaxon.com
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

import { exists, mapValues } from '../runtime';
import {
    V1CronSchedule,
    V1CronScheduleFromJSON,
    V1CronScheduleFromJSONTyped,
    V1CronScheduleToJSON,
    V1DateTimeSchedule,
    V1DateTimeScheduleFromJSON,
    V1DateTimeScheduleFromJSONTyped,
    V1DateTimeScheduleToJSON,
    V1IntervalSchedule,
    V1IntervalScheduleFromJSON,
    V1IntervalScheduleFromJSONTyped,
    V1IntervalScheduleToJSON,
} from './';

/**
 * 
 * @export
 * @interface V1Schedule
 */
export interface V1Schedule {
    /**
     * 
     * @type {V1CronSchedule}
     * @memberof V1Schedule
     */
    cron?: V1CronSchedule;
    /**
     * 
     * @type {V1DateTimeSchedule}
     * @memberof V1Schedule
     */
    datetime?: V1DateTimeSchedule;
    /**
     * 
     * @type {V1IntervalSchedule}
     * @memberof V1Schedule
     */
    interval?: V1IntervalSchedule;
}

export function V1ScheduleFromJSON(json: any): V1Schedule {
    return V1ScheduleFromJSONTyped(json, false);
}

export function V1ScheduleFromJSONTyped(json: any, ignoreDiscriminator: boolean): V1Schedule {
    if ((json === undefined) || (json === null)) {
        return json;
    }
    return {
        
        'cron': !exists(json, 'cron') ? undefined : V1CronScheduleFromJSON(json['cron']),
        'datetime': !exists(json, 'datetime') ? undefined : V1DateTimeScheduleFromJSON(json['datetime']),
        'interval': !exists(json, 'interval') ? undefined : V1IntervalScheduleFromJSON(json['interval']),
    };
}

export function V1ScheduleToJSON(value?: V1Schedule | null): any {
    if (value === undefined) {
        return undefined;
    }
    if (value === null) {
        return null;
    }
    return {
        
        'cron': V1CronScheduleToJSON(value.cron),
        'datetime': V1DateTimeScheduleToJSON(value.datetime),
        'interval': V1IntervalScheduleToJSON(value.interval),
    };
}


